﻿/**
 * 
 * Copyright 2009, 2010 Mike Jamer [email: mikejamer@gmail.com ]
 * 
 * This File is part of Moose IRC
 * 
 * MooseIRC is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * MooseIRC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with MooseIRC.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using moose.irc;

namespace TestChannelStructure {

    /// <summary>
    /// Form used for testing entities
    /// </summary>
    public partial class EntityDebugForm : Form {

        #region [Construction]

        /// <summary>
        /// Initialize Entity Debug Form
        /// </summary>
        public EntityDebugForm() {
            InitializeComponent();
            return;
        }

        public EntityDebugForm(string entity_string) : this() {
            txtEntityString.Text = entity_string;
            return;
        }

        #endregion

        #region [Form Events]

        /// <summary>
        /// Parses Entity String
        /// </summary>
        private void cmdParseEntityString_Click(object sender, EventArgs e) {

            if (txtEntityString.Text.Contains('#')) {
                IrcChannel channel = new IrcChannel(txtEntityString.Text);
                txtNickname.Text = channel.Name;
            }
            else {
                IrcUser user = new IrcUser(txtEntityString.Text);
                txtNickname.Text = user.Nickname;
                txtUsername.Text = user.Username;
                txtHostName.Text = user.Hostname;
            }

            return;
        }

        #endregion

    }

    

}
